﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DataAccessLayer;
namespace logicunivesityinventorystore
{
    public partial class SelectItem : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                DropDownList1.DataSource = new ItemFacade().FindAllCategory();
                DropDownList1.DataTextField = "CategoryName";
                DropDownList1.DataValueField = "CategoryID";
                DropDownList1.DataBind();
                ModalPopupExtender.Show();
            }
            ModalPopupExtender.Show();
        }

        protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)
        {
            //GridView1.DataSource = new ItemFacade().FindAllByCategory(DropDownList2.SelectedValue);
            //GridView1.DataBind();
        }

        protected void DropDownList2_SelectedIndexChanged1(object sender, EventArgs e)
        {
            GridView1.DataSource = new ItemFacade().FindAllByCategory(DropDownList2.SelectedValue);
            GridView1.DataBind();
        }
    }
}